package com.sixth.controller;

import com.sixth.service.StaffService;
import com.sixth.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: ssm002
 * @description:
 * @author:
 * @create: 2021-12-10 18:57
 **/
@Controller
@RequestMapping("/login")
public class LoginController {
    @Autowired  //按照类型匹配
    private StaffService staffService; //spring容器帮你注入对象。
    @RequestMapping("/login")
    @ResponseBody
    public CommonResult login(Integer staffid, String password){
        CommonResult result=staffService.findByUserameAndPassword(staffid,password);
        return result;
    }

}
